package coreconcurrency;

import java.util.ArrayList;
import java.util.List;

/**
 * create by yongli on 2022-03-03 20:40
 * 模拟耗时操作，
 * 应用于多线程操作环境
 */

public class MockService {
    public static final int N= 1000;

    public List<MockDto> list(Object param){
        System.out.println(param);
        try{
            Thread.sleep(1000);
        }catch (Exception e){
            e.printStackTrace();
        }
        List<MockDto> ls =new ArrayList<>();
        for(int i=0;i<1000;i++){
            MockDto mockDto =new MockDto("liyong"+i+"st",i);
            ls.add(mockDto);
        }
        return ls;
    }


    public List<MockDto> delete(Object param){
        System.out.println(param);
        try{
            Thread.sleep(1000);
        }catch (Exception e){
            e.printStackTrace();
        }
        List<MockDto> ls =new ArrayList<>();
        for(int i=0;i<1000;i++){
            MockDto mockDto =new MockDto("liyong"+i+"st",i);
            ls.add(mockDto);
        }
        return ls;
    }





}
